import { loadPlugin, loadPluginFn } from '../../app/config/loadplugin.config.js';

import sdkIndexHtml from 'ngtemplate!html!../../../tpls/sdk/sdk.index.html';
import sdkContentHtml from 'ngtemplate!html!../../../tpls/sdk/sdk.content.html';


/**
 * SDK模块路由设置
 */
RaceRouter.$inject = ['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider', '$ocLazyLoadProvider'];
function RaceRouter($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider, $ocLazyLoadProvider) {

	//set router
    $stateProvider

		// 赛事管理
		.state('sdk', {
			abstract: true,
		    url: '/sdk',
		    data: { 
		        pageTitle: '概况' 
		    },
		    controller: 'DashboardController',
		    templateUrl: sdkIndexHtml,
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

		// 赛事管理主页
		.state('sdk.index', {
		    url: '/index',
		    data: { 
		        pageTitle: '概况' 
		    },
		    templateUrl: sdkContentHtml,
		    controller: 'NavigationController',
		    resolve: {
		    	loadPlugin: loadPluginFn([loadPlugin.qrcode, loadPlugin.clipboard, loadPlugin.moment, loadPlugin.flot, loadPlugin.angles])
		    }
		})

}

export default RaceRouter;